home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / diag < prev    next >
Text File  |  1994-04-25  |  533b  |  21 lines

  1. diag:
  2.  
  3. Syntax:    diag ( A )
  4.     diag ( A , K )
  5.  
  6. Description:
  7.  
  8.     If the 1st argument is a 1xN matrix construct a diagonal
  9.     matrix from the input . Optionally if K (scalar) is specified
  10.     then create a matrix with the vector as the Kth diagonal.
  11.  
  12.     If the 1st argument is a MxN matrix, construct a 1xN matrix
  13.     from the diagonal elements of the input matrix. Optionally if
  14.     K is specified return the vector from the Kth diagonal of the
  15.     input matrix.
  16.  
  17.     K < 0 is below the main diagonal.
  18.     K > 0 is above the main diagonal.
  19.  
  20. See Also: tril, triu
  21.